import { post, form } from '@/utils/request'

export default {
  listStation: query => post('/api/admin/station/page', query),
  listStudent: query => post('/api/admin/student/page', query),
  deleteStudent: id => post('/api/admin/student/delete/' + id),
  selectStudent: id => post('/api/admin/student/select/' + id),
  createStudent: query => post('/api/admin/student/edit', query),
  listClass: query => post('/api/admin/class/page', query),
  deleteClass: id => post('/api/admin/class/delete/' + id),
  selectClass: id => post('/api/admin/class/select/' + id),
  createClass: query => post('/api/admin/class/edit', query),
  batchCreateClass: query => post('/api/admin/class/batchCreate'),
  uploadFile: (url, file) => {
    const param = new FormData()
    param.append('file', file)
    return form(url, param, 300000)
  }
}
